package com.tools.pojo.analysis.dto;

import com.tools.pojo.test.AnalysisResult;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Setter
@Getter
public class MedicalAnalysisResult extends AnalysisResult {

    // getters and setters
    private List<PatientAnalysisResult> patientResults;
    private List<RuleStatistics> ruleStatistics;
    private int totalPatients;
    private int patientsWithMatches;
    private double averageMatchedRules;

    // 计算总匹配规则数
    public int getTotalMatchedRules() {
        return patientResults.stream()
                .mapToInt(PatientAnalysisResult::getMatchedRules)
                .sum();
    }

}
